﻿ 

 

// ******************************************************
// 这段代码是自动生成的
// 修改里面的代码，下次生成的时候会被覆盖
// ******************************************************
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using System.Threading.Tasks;
using Sharp.Application;
using Sharp.DataTransferObject;
using System.ServiceModel.Activation;
using Sharp.Infrastructure.Search;
using Sharp.ServiceContracts;
using Sharp.Infrastructure;
using Sharp.Infrastructure.IoC;
using Sharp.DataTransferObject.Query;
namespace Sharp.Services.Controllers
{
	[Authorize]
	public class UserServiceController : ApiController,IUserService
	{
		private readonly IUserService _impl = ServiceLocator.Instance.GetService<IUserService>();
		
		
		public Result ResetPassword(ResetPasswordDTO userdto)
		{
			 return _impl.ResetPassword(userdto);
		}
		
		
		public Result SaveUser(UserDTO user)
		{
			 return _impl.SaveUser(user);
		}
		
		
		public Result DeleteUsers(IList<System.Int32> userids)
		{
			 return _impl.DeleteUsers(userids);
		}
		
		
		public Boolean ValidateUser(String userName, String password)
		{
			 return _impl.ValidateUser(userName, password);
		}
		
		
		public Boolean DisableUser(UserDTO user)
		{
			 return _impl.DisableUser(user);
		}
		
		
		public Boolean UnlockUser(String userName)
		{
			 return _impl.UnlockUser(userName);
		}
		
		
		public Boolean EnableUser(UserDTO user)
		{
			 return _impl.EnableUser(user);
		}
		
		[AllowAnonymous]
		public Result<Sharp.DataTransferObject.UserDTO> GetUserByKey(Int32 id)
		{
			 return _impl.GetUserByKey(id);
		}
		
		
		public Result<Sharp.DataTransferObject.UserDTO> GetUserByEmail(String email)
		{
			 return _impl.GetUserByEmail(email);
		}
		
		[AllowAnonymous]
		public Result<Sharp.DataTransferObject.UserDTO> GetUserByName(String userName)
		{
			 return _impl.GetUserByName(userName);
		}
		[HttpPost]
		
		public PagedResult<Sharp.DataTransferObject.UserDTO> GetUsersPaged(PagingFeature pf)
		{
			 return _impl.GetUsersPaged(pf);
		}
		
		
		public Result AssignRole(Int32[] userIds, Int32 roleId)
		{
			 return _impl.AssignRole(userIds, roleId);
		}
		
		
		public IEnumerable<Sharp.DataTransferObject.PermissionDTO> GetPermissionByUserName(String username)
		{
			 return _impl.GetPermissionByUserName(username);
		}
		
		
		public Boolean ChangePassword(String username, String oldPassword, String newPassword)
		{
			 return _impl.ChangePassword(username, oldPassword, newPassword);
		}
		
		
		public Boolean ChangePasswordQuestionAndAnswer(String username, String password, String newPasswordQuestion, String newPasswordAnswer)
		{
			 return _impl.ChangePasswordQuestionAndAnswer(username, password, newPasswordQuestion, newPasswordAnswer);
		}
		
		[AllowAnonymous]
		public Result<Sharp.DataTransferObject.UserDTO> TryLogin(UserDTO userDTO)
		{
			 return _impl.TryLogin(userDTO);
		}
		
		[AllowAnonymous]
		public void SaveLog(String log)
		{
			  _impl.SaveLog(log);
		}
		
		
		public UserLogDTO GetUserLogInfo(Int32 id)
		{
			 return _impl.GetUserLogInfo(id);
		}
		
		
		public Result DeleteUserLogs(Int32[] ids)
		{
			 return _impl.DeleteUserLogs(ids);
		}
		[HttpPost]
		
		public PagedResult<Sharp.DataTransferObject.UserLogDTO> GetUserLogPaged(PagingFeature pf)
		{
			 return _impl.GetUserLogPaged(pf);
		}
		
		
		public Result RelationUser(Int32 userId, [FromBody] Int32[] roleIds)
		{
			 return _impl.RelationUser(userId, roleIds);
		}
		
		
		public Result RelationUserForGroup(Int32 groupId, [FromBody] Int32[] userIds)
		{
			 return _impl.RelationUserForGroup(groupId, userIds);
		}
		
		
		public Result ForgotPassword(ForgotPasswordDTO dto)
		{
			 return _impl.ForgotPassword(dto);
		}
		
		
		public Result<System.Int32> IncrementAccessFailedCount(Int32 userId)
		{
			 return _impl.IncrementAccessFailedCount(userId);
		}
		
		
		public void ResetAccessFailedCount(Int32 userId)
		{
			  _impl.ResetAccessFailedCount(userId);
		}
		
		
		public void SetLockoutEnabled(Int32 id, Boolean enabled)
		{
			  _impl.SetLockoutEnabled(id, enabled);
		}
		
		
		public void SetLockoutEndDate(Int32 id, DateTimeOffset lockoutEnd)
		{
			  _impl.SetLockoutEndDate(id, lockoutEnd);
		}
		
		
		public Result SendMessage(MessageDTO model)
		{
			 return _impl.SendMessage(model);
		}
		
		
		public Result DraftMessage(MessageDTO model)
		{
			 return _impl.DraftMessage(model);
		}
		
		
		public Result DeleteMessages(Int32[] ids)
		{
			 return _impl.DeleteMessages(ids);
		}
		
		
		public MessageDTO GetMessageInfo(Int32 id)
		{
			 return _impl.GetMessageInfo(id);
		}
		[HttpPost]
		
		public PagedResult<Sharp.DataTransferObject.MessageDTO> GetMessagePaged(PagingFeature pf)
		{
			 return _impl.GetMessagePaged(pf);
		}
		[HttpPost]
		
		public PagedResult<Sharp.DataTransferObject.MessageDTO> GetMessageOutboxPaged(PagingFeature pf)
		{
			 return _impl.GetMessageOutboxPaged(pf);
		}
		[HttpPost]
		
		public PagedResult<Sharp.DataTransferObject.MessageDTO> GetMessageDraftboxPaged(PagingFeature pf)
		{
			 return _impl.GetMessageDraftboxPaged(pf);
		}
		[HttpPost]
		
		public PagedResult<Sharp.DataTransferObject.MessageDTO> GetMessageDustbinPaged(PagingFeature pf)
		{
			 return _impl.GetMessageDustbinPaged(pf);
		}
		
		
		public Task<Result<IList<Sharp.DataTransferObject.MessageDTO>>> NoReadMessages()
		{
			 return _impl.NoReadMessages();
		}
		
		
		public Result SendNotice(NoticeDTO model)
		{
			 return _impl.SendNotice(model);
		}
		
		
		public Result DeleteNotices(Int32[] ids)
		{
			 return _impl.DeleteNotices(ids);
		}
		
		
		public NoticeDTO GetNoticeInfo(Int32 id)
		{
			 return _impl.GetNoticeInfo(id);
		}
		
		
		public Task<Result<IList<Sharp.DataTransferObject.NoticeDTO>>> NoReadNotices()
		{
			 return _impl.NoReadNotices();
		}
		[HttpPost]
		
		public PagedResult<Sharp.DataTransferObject.NoticeDTO> GetNoticePaged(PagingFeature pf)
		{
			 return _impl.GetNoticePaged(pf);
		}
		
		
		public Task<IEnumerable<Sharp.DataTransferObject.PermissionDTO>> AllPermissions()
		{
			 return _impl.AllPermissions();
		}
		
		
		public Task<IEnumerable<Sharp.DataTransferObject.PermissionDTO>> AllAvailablePermissions()
		{
			 return _impl.AllAvailablePermissions();
		}
		
		
		public Task<IEnumerable<Sharp.DataTransferObject.PermissionDTO>> GetPermissionByRoleId(Int32 roleId)
		{
			 return _impl.GetPermissionByRoleId(roleId);
		}
		
		
		public Result SavePermission([FromBody] IList<System.Guid> ids, String owner, Int32 ownerId)
		{
			 return _impl.SavePermission(ids, owner, ownerId);
		}
		
		[AllowAnonymous]
		public Task<IEnumerable<Sharp.DataTransferObject.PermissionDTO>> GetPermissionById(Int32 userId)
		{
			 return _impl.GetPermissionById(userId);
		}
		
		[AllowAnonymous]
		public Result RefurbishAvailablePermissionData(PermissionDataQuery query)
		{
			 return _impl.RefurbishAvailablePermissionData(query);
		}
		
		[AllowAnonymous]
		public Result AllotAllPermissionToAdminRole()
		{
			 return _impl.AllotAllPermissionToAdminRole();
		}
		
		
		public Result AvailablePermissionToPermission(Guid[] ids)
		{
			 return _impl.AvailablePermissionToPermission(ids);
		}
		
		
		public Result SaveOrgPermission(Guid[] orgIds, Int32 roleId)
		{
			 return _impl.SaveOrgPermission(orgIds, roleId);
		}
		
		
		public Result SaveRole(RoleDTO roleDTO)
		{
			 return _impl.SaveRole(roleDTO);
		}
		
		
		public IList<Sharp.DataTransferObject.RoleDTO> GetRoles()
		{
			 return _impl.GetRoles();
		}
		
		
		public RoleDTO GetRoleByKey(Int32 id)
		{
			 return _impl.GetRoleByKey(id);
		}
		
		
		public Result DeleteRoles(IList<System.Int32> roleIDs)
		{
			 return _impl.DeleteRoles(roleIDs);
		}
		[HttpPost]
		
		public PagedResult<Sharp.DataTransferObject.RoleDTO> GetRolePaged(PagingFeature pf)
		{
			 return _impl.GetRolePaged(pf);
		}

		/// <summary>
        /// 为客户端ajax跨域请求必须的方法
        /// </summary>
        /// <returns></returns>
        public string Options()
        {
            // HTTP 200 response with empty body
            return null;
        }
	}
}